package com.vip.common.exception;

import com.vip.common.response.ErrorCode;

/**
 * 业务异常
 *
 * @author wgb
 * @date 2020/12/22 16:39
 */
public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = 1L;
    /**
     * 异常状态码
     */
    private ErrorCode errorCode;

    public BusinessException(ErrorCode errorCode, String description) {
        super(description);
        this.errorCode = errorCode;
    }

    public BusinessException(ErrorCode errorCode, String description, Throwable cause) {
        super(description, cause);
        this.errorCode = errorCode;
    }

    public ErrorCode getErrorCode() {
        return this.errorCode;
    }

    public void setErrorCode(ErrorCode errorCode) {
        this.errorCode = errorCode;
    }
}
